using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Shpm.App.Input.Dao;
using Shpm.App.Input.Bean;
using Shpm.System;
using Shpm.App.Commons.Db.Beans.Master;

public partial class App_Input_HealthCaseHistoryForm : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
            ViewState["MEMBER_NO"] = (string)Request.QueryString["MEMBER_NO"];

            MemberSrhDao dao = new MemberSrhDao();
            MemberSrhBean bean = new MemberSrhBean();
            bean.MemberNo = Convert.ToString(ViewState["MEMBER_NO"]);
            bean = dao.GetMember(bean);

            if(bean != null)
            {
                this.txtDisease.Text = bean.MemberDisease;
                this.txtDiseaseHis.Text = bean.MemberDiseaseHis;
            }
        }
    }
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        SysUserManager manager = new SysUserManager(Context);
        SysUserBean sysUserBean = manager.getSysUserBean();
        MstSysUserBean mstSysUserBean =
            sysUserBean == null ? null : sysUserBean.getMstSysUserBean();
        MstEmployeeBean mstEmpBean =
            sysUserBean == null ? null : sysUserBean.getEmployeeBean();
        string loginId = mstSysUserBean == null ? "" : mstSysUserBean.SysUserId;

        MemberSrhBean bean = new MemberSrhBean();
        MemberSrhDao dao = new MemberSrhDao();
        bean.MemberDisease = this.txtDisease.Text;
        bean.MemberDiseaseHis = this.txtDiseaseHis.Text;
        bean.MemberNo = Convert.ToString(ViewState["MEMBER_NO"]);
        bean.UserId = loginId;
        dao.UpdMemberDisease(bean);
        ((Design_MasterPage)this.Master).InfoMessage =
                          HttpContext.GetGlobalResourceObject(Constants.GLOBAL_RESOURCE_NAME, "I0002").ToString();
    }
}
